From ce27fde65d3c2dad695f80a163fca68d11c384ba Mon Sep 17 00:00:00 2001 From: "cl349@firebug.cl.cam.ac.uk" Date: Mon, 5 Sep 2005 14:04:36 +0000 Subject: [PATCH] Keep start_info in page provided by domain builder instead of making a copy. - page is moved next to store/console pages -- these are never put in the free page pool by the domain - xen_start_info is now a pointer to the original page instead of the copy Signed-off-by: Christian Limpach --- .../arch/xen/i386/kernel/cpu/mtrr/main.c | 2 +- .../arch/xen/i386/kernel/head.S | 10 ++-- .../arch/xen/i386/kernel/setup.c | 52 +++++++++---------- .../arch/xen/i386/kernel/swiotlb.c | 2 +- .../arch/xen/i386/kernel/time.c | 4 +- linux-2.6-xen-sparse/arch/xen/i386/mm/init.c | 12 ++--- .../arch/xen/i386/mm/ioremap.c | 4 +- .../arch/xen/kernel/ctrl_if.c | 6 +-- linux-2.6-xen-sparse/arch/xen/kernel/reboot.c | 10 ++-- .../arch/xen/x86_64/kernel/e820.c | 2 +- .../arch/xen/x86_64/kernel/head.S | 11 ++-- .../arch/xen/x86_64/kernel/head64.c | 5 +- .../arch/xen/x86_64/kernel/setup.c | 20 +++---- .../arch/xen/x86_64/mm/init.c | 12 ++--- .../drivers/xen/balloon/balloon.c | 4 +- .../drivers/xen/blkback/blkback.c | 4 +- .../drivers/xen/blkfront/blkfront.c | 4 +- .../drivers/xen/blktap/blktap.c | 4 +- .../drivers/xen/console/console.c | 8 +-- .../drivers/xen/console/xencons_ring.c | 15 +++--- .../drivers/xen/netback/netback.c | 4 +- .../drivers/xen/netfront/netfront.c | 2 +- .../drivers/xen/privcmd/privcmd.c | 10 ++-- .../drivers/xen/tpmback/tpmback.c | 4 +- .../drivers/xen/usbback/usbback.c | 4 +- .../drivers/xen/usbfront/usbfront.c | 4 +- .../drivers/xen/xenbus/xenbus_comms.c | 20 +++---- .../drivers/xen/xenbus/xenbus_probe.c | 6 +-- .../asm-i386/mach-xen/setup_arch_post.h | 4 +- .../include/asm-xen/asm-i386/setup.h | 4 +- .../include/asm-xen/asm-x86_64/bootsetup.h | 4 +- .../asm-x86_64/mach-xen/setup_arch_post.h | 4 +- .../include/asm-xen/hypervisor.h | 8 +-- tools/libxc/xc_linux_build.c | 14 ++--- xen/arch/x86/domain_build.c | 12 ++--- 35 files changed, 142 insertions(+), 153 deletions(-) diff --git a/linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/mtrr/main.c b/linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/mtrr/main.c index 501ea3fce8..41808f1711 100644 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/mtrr/main.c +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/mtrr/main.c @@ -147,7 +147,7 @@ static int __init mtrr_init(void) { struct cpuinfo_x86 *c = &boot_cpu_data; - if (!(xen_start_info.flags & SIF_PRIVILEGED)) + if (!(xen_start_info->flags & SIF_PRIVILEGED)) return -ENODEV; if ((!cpu_has(c, X86_FEATURE_MTRR)) && diff --git a/linux-2.6-xen-sparse/arch/xen/i386/kernel/head.S b/linux-2.6-xen-sparse/arch/xen/i386/kernel/head.S index 2c5295714b..35c68031fb 100644 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/head.S +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/head.S @@ -38,18 +38,14 @@ #define X86_VENDOR_ID new_cpu_data+CPUINFO_x86_vendor_id ENTRY(startup_32) - cld - - /* Copy the necessary stuff from xen_start_info structure. */ - mov $xen_start_info_union,%edi - mov $512,%ecx - rep movsl + movl %esi,xen_start_info #ifdef CONFIG_SMP ENTRY(startup_32_smp) - cld #endif /* CONFIG_SMP */ + cld + /* Set up the stack pointer */ lss stack_start,%esp diff --git a/linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c b/linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c index bd1babe742..1cbe2bb77e 100644 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c @@ -289,7 +289,7 @@ static void __init probe_roms(void) int i; /* Nothing to do if not running in dom0. */ - if (!(xen_start_info.flags & SIF_INITDOMAIN)) + if (!(xen_start_info->flags & SIF_INITDOMAIN)) return; /* video rom */ @@ -363,7 +363,7 @@ unsigned int *phys_to_machine_mapping, *pfn_to_mfn_frame_list; EXPORT_SYMBOL(phys_to_machine_mapping); /* Raw start-of-day parameters from the hypervisor. */ -union xen_start_info_union xen_start_info_union; +start_info_t *xen_start_info; static void __init limit_regions(unsigned long long size) { @@ -703,7 +703,7 @@ static void __init parse_cmdline_early (char ** cmdline_p) if ((max_cmdline = MAX_GUEST_CMDLINE) > COMMAND_LINE_SIZE) max_cmdline = COMMAND_LINE_SIZE; - memcpy(saved_command_line, xen_start_info.cmd_line, max_cmdline); + memcpy(saved_command_line, xen_start_info->cmd_line, max_cmdline); /* Save unparsed command line copy for /proc/cmdline */ saved_command_line[max_cmdline-1] = '\0'; @@ -934,8 +934,8 @@ void __init find_max_pfn(void) /* We don't use the fake e820 because we need to respond to user override. */ void __init find_max_pfn(void) { - if ( xen_override_max_pfn < xen_start_info.nr_pages ) - xen_override_max_pfn = xen_start_info.nr_pages; + if ( xen_override_max_pfn < xen_start_info->nr_pages ) + xen_override_max_pfn = xen_start_info->nr_pages; max_pfn = xen_override_max_pfn; } #endif /* XEN */ @@ -1082,8 +1082,8 @@ static unsigned long __init setup_memory(void) * partially used pages are not usable - thus * we are rounding upwards: */ - min_low_pfn = PFN_UP(__pa(xen_start_info.pt_base)) + - xen_start_info.nr_pt_frames; + min_low_pfn = PFN_UP(__pa(xen_start_info->pt_base)) + + xen_start_info->nr_pt_frames; find_max_pfn(); @@ -1189,7 +1189,7 @@ void __init setup_bootmem_allocator(void) #endif /* !CONFIG_XEN */ #ifdef CONFIG_BLK_DEV_INITRD - if (xen_start_info.mod_start) { + if (xen_start_info->mod_start) { if (INITRD_START + INITRD_SIZE <= (max_low_pfn << PAGE_SHIFT)) { /*reserve_bootmem(INITRD_START, INITRD_SIZE);*/ initrd_start = INITRD_START + PAGE_OFFSET; @@ -1206,7 +1206,7 @@ void __init setup_bootmem_allocator(void) } #endif - phys_to_machine_mapping = (unsigned int *)xen_start_info.mfn_list; + phys_to_machine_mapping = (unsigned int *)xen_start_info->mfn_list; } /* @@ -1280,7 +1280,7 @@ static void __init register_memory(void) else legacy_init_iomem_resources(&code_resource, &data_resource); - if (xen_start_info.flags & SIF_INITDOMAIN) + if (xen_start_info->flags & SIF_INITDOMAIN) /* EFI systems may still have VGA */ request_resource(&iomem_resource, &video_ram_resource); @@ -1536,8 +1536,8 @@ void __init setup_arch(char **cmdline_p) init_mm.start_code = (unsigned long) _text; init_mm.end_code = (unsigned long) _etext; init_mm.end_data = (unsigned long) _edata; - init_mm.brk = (PFN_UP(__pa(xen_start_info.pt_base)) + - xen_start_info.nr_pt_frames) << PAGE_SHIFT; + init_mm.brk = (PFN_UP(__pa(xen_start_info->pt_base)) + + xen_start_info->nr_pt_frames) << PAGE_SHIFT; /* XEN: This is nonsense: kernel may not even be contiguous in RAM. */ /*code_resource.start = virt_to_phys(_text);*/ @@ -1574,37 +1574,37 @@ void __init setup_arch(char **cmdline_p) #endif /* Make sure we have a correctly sized P->M table. */ - if (max_pfn != xen_start_info.nr_pages) { + if (max_pfn != xen_start_info->nr_pages) { phys_to_machine_mapping = alloc_bootmem_low_pages( max_pfn * sizeof(unsigned int)); - if (max_pfn > xen_start_info.nr_pages) { + if (max_pfn > xen_start_info->nr_pages) { /* set to INVALID_P2M_ENTRY */ memset(phys_to_machine_mapping, ~0, max_pfn * sizeof(unsigned int)); memcpy(phys_to_machine_mapping, - (unsigned int *)xen_start_info.mfn_list, - xen_start_info.nr_pages * sizeof(unsigned int)); + (unsigned int *)xen_start_info->mfn_list, + xen_start_info->nr_pages * sizeof(unsigned int)); } else { struct xen_memory_reservation reservation = { - .extent_start = (unsigned long *)xen_start_info.mfn_list + max_pfn, - .nr_extents = xen_start_info.nr_pages - max_pfn, + .extent_start = (unsigned long *)xen_start_info->mfn_list + max_pfn, + .nr_extents = xen_start_info->nr_pages - max_pfn, .extent_order = 0, .domid = DOMID_SELF }; memcpy(phys_to_machine_mapping, - (unsigned int *)xen_start_info.mfn_list, + (unsigned int *)xen_start_info->mfn_list, max_pfn * sizeof(unsigned int)); /* N.B. below relies on sizeof(int) == sizeof(long). */ BUG_ON(HYPERVISOR_memory_op( XENMEM_decrease_reservation, &reservation) != - (xen_start_info.nr_pages - max_pfn)); + (xen_start_info->nr_pages - max_pfn)); } free_bootmem( - __pa(xen_start_info.mfn_list), - PFN_PHYS(PFN_UP(xen_start_info.nr_pages * + __pa(xen_start_info->mfn_list), + PFN_PHYS(PFN_UP(xen_start_info->nr_pages * sizeof(unsigned int)))); } @@ -1633,7 +1633,7 @@ void __init setup_arch(char **cmdline_p) } #endif - if (xen_start_info.flags & SIF_INITDOMAIN) + if (xen_start_info->flags & SIF_INITDOMAIN) dmi_scan_machine(); #ifdef CONFIG_X86_GENERICARCH @@ -1647,7 +1647,7 @@ void __init setup_arch(char **cmdline_p) HYPERVISOR_physdev_op(&op); #ifdef CONFIG_ACPI_BOOT - if (!(xen_start_info.flags & SIF_INITDOMAIN)) { + if (!(xen_start_info->flags & SIF_INITDOMAIN)) { printk(KERN_INFO "ACPI in unprivileged domain disabled\n"); acpi_disabled = 1; acpi_ht = 0; @@ -1673,8 +1673,8 @@ void __init setup_arch(char **cmdline_p) register_memory(); - if (xen_start_info.flags & SIF_INITDOMAIN) { - if (!(xen_start_info.flags & SIF_PRIVILEGED)) + if (xen_start_info->flags & SIF_INITDOMAIN) { + if (!(xen_start_info->flags & SIF_PRIVILEGED)) panic("Xen granted us console access " "but not privileged status"); diff --git a/linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c b/linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c index 8d8fe38bf5..d72d920376 100644 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c @@ -181,7 +181,7 @@ swiotlb_init(void) * Otherwise, enable for domain 0 if the machine has 'lots of memory', * which we take to mean more than 2GB. */ - if (xen_start_info.flags & SIF_INITDOMAIN) { + if (xen_start_info->flags & SIF_INITDOMAIN) { dom0_op_t op; op.cmd = DOM0_PHYSINFO; if ((HYPERVISOR_dom0_op(&op) == 0) && diff --git a/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c b/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c index 3b85e34798..7f5454e1ee 100644 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c @@ -445,7 +445,7 @@ int do_settimeofday(struct timespec *tv) sec = tv->tv_sec; __normalize_time(&sec, &nsec); - if ((xen_start_info.flags & SIF_INITDOMAIN) && + if ((xen_start_info->flags & SIF_INITDOMAIN) && !independent_wallclock) { op.cmd = DOM0_SETTIME; op.u.settime.secs = sec; @@ -476,7 +476,7 @@ static int set_rtc_mmss(unsigned long nowtime) WARN_ON(irqs_disabled()); - if (!(xen_start_info.flags & SIF_INITDOMAIN)) + if (!(xen_start_info->flags & SIF_INITDOMAIN)) return 0; /* gets recalled with irq locally disabled */ diff --git a/linux-2.6-xen-sparse/arch/xen/i386/mm/init.c b/linux-2.6-xen-sparse/arch/xen/i386/mm/init.c index ba3c9a6b27..4ef646b3fe 100644 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/init.c +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/init.c @@ -159,7 +159,7 @@ static void __init kernel_physical_mapping_init(pgd_t *pgd_base) pte_t *pte; int pgd_idx, pmd_idx, pte_ofs; - unsigned long max_ram_pfn = xen_start_info.nr_pages; + unsigned long max_ram_pfn = xen_start_info->nr_pages; if (max_ram_pfn > max_low_pfn) max_ram_pfn = max_low_pfn; @@ -317,7 +317,7 @@ void __init one_highpage_init(struct page *page, int pfn, int bad_ppro) ClearPageReserved(page); set_bit(PG_highmem, &page->flags); set_page_count(page, 1); - if (pfn < xen_start_info.nr_pages) + if (pfn < xen_start_info->nr_pages) __free_page(page); totalhigh_pages++; } else @@ -356,7 +356,7 @@ pgd_t *swapper_pg_dir; static void __init pagetable_init (void) { unsigned long vaddr; - pgd_t *pgd_base = (pgd_t *)xen_start_info.pt_base; + pgd_t *pgd_base = (pgd_t *)xen_start_info->pt_base; int i; swapper_pg_dir = pgd_base; @@ -535,14 +535,14 @@ void __init paging_init(void) kmap_init(); /* Switch to the real shared_info page, and clear the dummy page. */ - set_fixmap(FIX_SHARED_INFO, xen_start_info.shared_info); + set_fixmap(FIX_SHARED_INFO, xen_start_info->shared_info); HYPERVISOR_shared_info = (shared_info_t *)fix_to_virt(FIX_SHARED_INFO); memset(empty_zero_page, 0, sizeof(empty_zero_page)); #ifdef CONFIG_XEN_PHYSDEV_ACCESS /* Setup mapping of lower 1st MB */ for (i = 0; i < NR_FIX_ISAMAPS; i++) - if (xen_start_info.flags & SIF_PRIVILEGED) + if (xen_start_info->flags & SIF_PRIVILEGED) set_fixmap(FIX_ISAMAP_BEGIN - i, i * PAGE_SIZE); else __set_fixmap(FIX_ISAMAP_BEGIN - i, @@ -639,7 +639,7 @@ void __init mem_init(void) /* this will put all low memory onto the freelists */ totalram_pages += free_all_bootmem(); /* XEN: init and count low-mem pages outside initial allocation. */ - for (pfn = xen_start_info.nr_pages; pfn < max_low_pfn; pfn++) { + for (pfn = xen_start_info->nr_pages; pfn < max_low_pfn; pfn++) { ClearPageReserved(&mem_map[pfn]); set_page_count(&mem_map[pfn], 1); totalram_pages++; diff --git a/linux-2.6-xen-sparse/arch/xen/i386/mm/ioremap.c b/linux-2.6-xen-sparse/arch/xen/i386/mm/ioremap.c index 820eabd779..8e14408d54 100644 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/ioremap.c +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/ioremap.c @@ -178,7 +178,7 @@ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned l /* * Don't remap the low PCI/ISA area, it's always mapped.. */ - if (xen_start_info.flags & SIF_PRIVILEGED && + if (xen_start_info->flags & SIF_PRIVILEGED && phys_addr >= ISA_START_ADDRESS && last_addr < ISA_END_ADDRESS) return (void __iomem *) isa_bus_to_virt(phys_addr); @@ -332,7 +332,7 @@ void __init *bt_ioremap(unsigned long phys_addr, unsigned long size) /* * Don't remap the low PCI/ISA area, it's always mapped.. */ - if (xen_start_info.flags & SIF_PRIVILEGED && + if (xen_start_info->flags & SIF_PRIVILEGED && phys_addr >= ISA_START_ADDRESS && last_addr < ISA_END_ADDRESS) return isa_bus_to_virt(phys_addr); diff --git a/linux-2.6-xen-sparse/arch/xen/kernel/ctrl_if.c b/linux-2.6-xen-sparse/arch/xen/kernel/ctrl_if.c index 733103f475..583188d390 100644 --- a/linux-2.6-xen-sparse/arch/xen/kernel/ctrl_if.c +++ b/linux-2.6-xen-sparse/arch/xen/kernel/ctrl_if.c @@ -483,7 +483,7 @@ void ctrl_if_resume(void) { control_if_t *ctrl_if = get_ctrl_if(); - if ( xen_start_info.flags & SIF_INITDOMAIN ) + if ( xen_start_info->flags & SIF_INITDOMAIN ) { /* * The initial domain must create its own domain-controller link. @@ -500,7 +500,7 @@ void ctrl_if_resume(void) op.u.bind_interdomain.port2 = 0; if ( HYPERVISOR_event_channel_op(&op) != 0 ) BUG(); - xen_start_info.domain_controller_evtchn = op.u.bind_interdomain.port1; + xen_start_info->domain_controller_evtchn = op.u.bind_interdomain.port1; initdom_ctrlif_domcontroller_port = op.u.bind_interdomain.port2; bind_evtchn_to_cpu(op.u.bind_interdomain.port1, 0); } @@ -509,7 +509,7 @@ void ctrl_if_resume(void) FRONT_RING_ATTACH(&ctrl_if_tx_ring, &ctrl_if->tx_ring, CONTROL_RING_MEM); BACK_RING_ATTACH(&ctrl_if_rx_ring, &ctrl_if->rx_ring, CONTROL_RING_MEM); - ctrl_if_evtchn = xen_start_info.domain_controller_evtchn; + ctrl_if_evtchn = xen_start_info->domain_controller_evtchn; ctrl_if_irq = bind_evtchn_to_irq(ctrl_if_evtchn); memset(&ctrl_if_irq_action, 0, sizeof(ctrl_if_irq_action)); diff --git a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c index 49164498ab..19a760ee7a 100644 --- a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c +++ b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c @@ -185,8 +185,8 @@ static int __do_suspend(void *ignore) HYPERVISOR_shared_info = (shared_info_t *)empty_zero_page; clear_fixmap(FIX_SHARED_INFO); - memcpy(&suspend_record->resume_info, &xen_start_info, - sizeof(xen_start_info)); + memcpy(&suspend_record->resume_info, xen_start_info, + sizeof(*xen_start_info)); /* We'll stop somewhere inside this hypercall. When it returns, we'll start resuming after the restore. */ @@ -194,10 +194,10 @@ static int __do_suspend(void *ignore) shutting_down = SHUTDOWN_INVALID; - memcpy(&xen_start_info, &suspend_record->resume_info, - sizeof(xen_start_info)); + memcpy(xen_start_info, &suspend_record->resume_info, + sizeof(*xen_start_info)); - set_fixmap(FIX_SHARED_INFO, xen_start_info.shared_info); + set_fixmap(FIX_SHARED_INFO, xen_start_info->shared_info); HYPERVISOR_shared_info = (shared_info_t *)fix_to_virt(FIX_SHARED_INFO); diff --git a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/e820.c b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/e820.c index 71a1189f9a..8ca939aef1 100644 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/e820.c +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/e820.c @@ -524,7 +524,7 @@ extern union xen_start_info_union xen_start_info_union; */ unsigned long __init e820_end_of_ram(void) { - unsigned long max_end_pfn = xen_start_info.nr_pages; + unsigned long max_end_pfn = xen_start_info->nr_pages; if ( xen_override_max_pfn < max_end_pfn) xen_override_max_pfn = max_end_pfn; diff --git a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/head.S b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/head.S index 252af49d55..b1418e6afe 100644 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/head.S +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/head.S @@ -40,17 +40,14 @@ .globl startup_64 startup_64: ENTRY(_start) - cld - /* Copy the necessary stuff from xen_start_info structure. */ - movq $xen_start_info_union,%rdi - movq $256,%rcx - rep movsq + movq %rsi,xen_start_info(%rip) #ifdef CONFIG_SMP - ENTRY(startup_64_smp) - cld +ENTRY(startup_64_smp) #endif /* CONFIG_SMP */ + cld + movq init_rsp(%rip),%rsp /* zero EFLAGS after setting rsp */ pushq $0 diff --git a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/head64.c b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/head64.c index 990f8fb190..68e79771c0 100644 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/head64.c +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/head64.c @@ -90,8 +90,9 @@ void __init x86_64_start_kernel(char * real_mode_data) { int i; - phys_to_machine_mapping = (u32 *)xen_start_info.mfn_list; - start_pfn = (__pa(xen_start_info.pt_base) >> PAGE_SHIFT) + xen_start_info.nr_pt_frames; + phys_to_machine_mapping = (u32 *)xen_start_info->mfn_list; + start_pfn = (__pa(xen_start_info->pt_base) >> PAGE_SHIFT) + + xen_start_info->nr_pt_frames; for (i = 0; i < 256; i++) set_intr_gate(i, early_idt_handler); diff --git a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c index d92ce1aa3c..ca1225eb6f 100644 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c @@ -84,7 +84,7 @@ DEFINE_PER_CPU(multicall_entry_t, multicall_list[8]); DEFINE_PER_CPU(int, nr_multicall_ents); /* Raw start-of-day parameters from the hypervisor. */ -union xen_start_info_union xen_start_info_union; +start_info_t *xen_start_info; #endif /* @@ -314,7 +314,7 @@ static __init void parse_cmdline_early (char ** cmdline_p) if ((max_cmdline = MAX_GUEST_CMDLINE) > COMMAND_LINE_SIZE) max_cmdline = COMMAND_LINE_SIZE; - memcpy(saved_command_line, xen_start_info.cmd_line, max_cmdline); + memcpy(saved_command_line, xen_start_info->cmd_line, max_cmdline); saved_command_line[max_cmdline-1] = '\0'; #else memcpy(saved_command_line, COMMAND_LINE, COMMAND_LINE_SIZE); @@ -687,7 +687,7 @@ void __init setup_arch(char **cmdline_p) #endif #ifdef CONFIG_XEN #ifdef CONFIG_BLK_DEV_INITRD - if (xen_start_info.mod_start) { + if (xen_start_info->mod_start) { if (INITRD_START + INITRD_SIZE <= (end_pfn << PAGE_SHIFT)) { /*reserve_bootmem_generic(INITRD_START, INITRD_SIZE);*/ initrd_start = INITRD_START + PAGE_OFFSET; @@ -732,17 +732,17 @@ void __init setup_arch(char **cmdline_p) { int i, j; /* Make sure we have a large enough P->M table. */ - if (end_pfn > xen_start_info.nr_pages) { + if (end_pfn > xen_start_info->nr_pages) { phys_to_machine_mapping = alloc_bootmem( end_pfn * sizeof(u32)); memset(phys_to_machine_mapping, ~0, end_pfn * sizeof(u32)); memcpy(phys_to_machine_mapping, - (u32 *)xen_start_info.mfn_list, - xen_start_info.nr_pages * sizeof(u32)); + (u32 *)xen_start_info->mfn_list, + xen_start_info->nr_pages * sizeof(u32)); free_bootmem( - __pa(xen_start_info.mfn_list), - PFN_PHYS(PFN_UP(xen_start_info.nr_pages * + __pa(xen_start_info->mfn_list), + PFN_PHYS(PFN_UP(xen_start_info->nr_pages * sizeof(u32)))); } @@ -814,8 +814,8 @@ void __init setup_arch(char **cmdline_p) op.u.set_iopl.iopl = 1; HYPERVISOR_physdev_op(&op); - if (xen_start_info.flags & SIF_INITDOMAIN) { - if (!(xen_start_info.flags & SIF_PRIVILEGED)) + if (xen_start_info->flags & SIF_INITDOMAIN) { + if (!(xen_start_info->flags & SIF_PRIVILEGED)) panic("Xen granted us console access " "but not privileged status"); diff --git a/linux-2.6-xen-sparse/arch/xen/x86_64/mm/init.c b/linux-2.6-xen-sparse/arch/xen/x86_64/mm/init.c index 437ccac06e..a2182d5c98 100644 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/mm/init.c +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/mm/init.c @@ -423,7 +423,7 @@ static inline int make_readonly(unsigned long paddr) int readonly = 0; /* Make old and new page tables read-only. */ - if ((paddr >= (xen_start_info.pt_base - __START_KERNEL_map)) + if ((paddr >= (xen_start_info->pt_base - __START_KERNEL_map)) && (paddr < ((table_start << PAGE_SHIFT) + tables_space))) readonly = 1; /* @@ -474,8 +474,8 @@ static void __init phys_pud_init(pud_t *pud, unsigned long address, unsigned lon pte_save = pte; for (k = 0; k < PTRS_PER_PTE; pte++, k++, paddr += PTE_SIZE) { if ((paddr >= end) || - ((paddr >> PAGE_SHIFT) - >= xen_start_info.nr_pages)) { + ((paddr >> PAGE_SHIFT) >= + xen_start_info->nr_pages)) { __set_pte(pte, __pte(0)); continue; } @@ -522,7 +522,7 @@ void __init xen_init_pt(void) memset((void *)level2_kernel_pgt, 0, PAGE_SIZE); /* Find the initial pte page that was built for us. */ - page = (unsigned long *)xen_start_info.pt_base; + page = (unsigned long *)xen_start_info->pt_base; addr = page[pgd_index(__START_KERNEL_map)]; addr_to_page(addr, page); addr = page[pud_index(__START_KERNEL_map)]; @@ -671,7 +671,7 @@ void __init paging_init(void) free_area_init(zones_size); } - set_fixmap(FIX_SHARED_INFO, xen_start_info.shared_info); + set_fixmap(FIX_SHARED_INFO, xen_start_info->shared_info); HYPERVISOR_shared_info = (shared_info_t *)fix_to_virt(FIX_SHARED_INFO); memset(empty_zero_page, 0, sizeof(empty_zero_page)); @@ -682,7 +682,7 @@ void __init paging_init(void) int i; /* Setup mapping of lower 1st MB */ for (i = 0; i < NR_FIX_ISAMAPS; i++) - if (xen_start_info.flags & SIF_PRIVILEGED) + if (xen_start_info->flags & SIF_PRIVILEGED) set_fixmap(FIX_ISAMAP_BEGIN - i, i * PAGE_SIZE); else __set_fixmap(FIX_ISAMAP_BEGIN - i, diff --git a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c index ef76df83ec..6c0df1bec7 100644 --- a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c +++ b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c @@ -402,7 +402,7 @@ static int __init balloon_init(void) IPRINTK("Initialising balloon driver.\n"); - current_pages = min(xen_start_info.nr_pages, max_pfn); + current_pages = min(xen_start_info->nr_pages, max_pfn); target_pages = current_pages; balloon_low = 0; balloon_high = 0; @@ -422,7 +422,7 @@ static int __init balloon_init(void) balloon_pde->write_proc = balloon_write; /* Initialise the balloon with excess memory space. */ - for (pfn = xen_start_info.nr_pages; pfn < max_pfn; pfn++) { + for (pfn = xen_start_info->nr_pages; pfn < max_pfn; pfn++) { page = &mem_map[pfn]; if (!PageReserved(page)) balloon_append(page); diff --git a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c index f2352d7158..5f87070e7a 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c @@ -504,8 +504,8 @@ static int __init blkif_init(void) int i; struct page *page; - if ( !(xen_start_info.flags & SIF_INITDOMAIN) && - !(xen_start_info.flags & SIF_BLK_BE_DOMAIN) ) + if ( !(xen_start_info->flags & SIF_INITDOMAIN) && + !(xen_start_info->flags & SIF_BLK_BE_DOMAIN) ) return 0; blkif_interface_init(); diff --git a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c index 136f7d68d9..a507f66d93 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c @@ -757,8 +757,8 @@ static int wait_for_blkif(void) static int __init xlblk_init(void) { - if ((xen_start_info.flags & SIF_INITDOMAIN) - || (xen_start_info.flags & SIF_BLK_BE_DOMAIN) ) + if ((xen_start_info->flags & SIF_INITDOMAIN) || + (xen_start_info->flags & SIF_BLK_BE_DOMAIN) ) return 0; IPRINTK("Initialising virtual block device driver\n"); diff --git a/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c b/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c index 4d0b88c8ee..6041122f3f 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c +++ b/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c @@ -873,8 +873,8 @@ static int __init blkif_init(void) int i, j, err; struct page *page; /* - if ( !(xen_start_info.flags & SIF_INITDOMAIN) && - !(xen_start_info.flags & SIF_BLK_BE_DOMAIN) ) + if ( !(xen_start_info->flags & SIF_INITDOMAIN) && + !(xen_start_info->flags & SIF_BLK_BE_DOMAIN) ) return 0; */ blkif_interface_init(); diff --git a/linux-2.6-xen-sparse/drivers/xen/console/console.c b/linux-2.6-xen-sparse/drivers/xen/console/console.c index f19dd485e3..129cabec66 100644 --- a/linux-2.6-xen-sparse/drivers/xen/console/console.c +++ b/linux-2.6-xen-sparse/drivers/xen/console/console.c @@ -195,7 +195,7 @@ static int __init xen_console_init(void) void xen_console_init(void) #endif { - if ( xen_start_info.flags & SIF_INITDOMAIN ) + if ( xen_start_info->flags & SIF_INITDOMAIN ) { if ( xc_mode == XC_DEFAULT ) xc_mode = XC_SERIAL; @@ -266,7 +266,7 @@ void xencons_force_flush(void) int sz; /* Emergency console is synchronous, so there's nothing to flush. */ - if ( xen_start_info.flags & SIF_INITDOMAIN ) + if ( xen_start_info->flags & SIF_INITDOMAIN ) return; @@ -342,7 +342,7 @@ static void __xencons_tx_flush(void) { int sz, work_done = 0; - if ( xen_start_info.flags & SIF_INITDOMAIN ) + if ( xen_start_info->flags & SIF_INITDOMAIN ) { if ( x_char ) { @@ -770,7 +770,7 @@ static int __init xencons_init(void) tty_register_device(xencons_driver, 0, NULL); #endif - if ( xen_start_info.flags & SIF_INITDOMAIN ) + if ( xen_start_info->flags & SIF_INITDOMAIN ) { xencons_priv_irq = bind_virq_to_irq(VIRQ_CONSOLE); (void)request_irq(xencons_priv_irq, diff --git a/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c b/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c index 6083c6a326..eb205ee377 100644 --- a/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c +++ b/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c @@ -36,12 +36,12 @@ struct ring_head static inline struct ring_head *outring(void) { - return machine_to_virt(xen_start_info.console_mfn << PAGE_SHIFT); + return machine_to_virt(xen_start_info->console_mfn << PAGE_SHIFT); } static inline struct ring_head *inring(void) { - return machine_to_virt(xen_start_info.console_mfn << PAGE_SHIFT) + return machine_to_virt(xen_start_info->console_mfn << PAGE_SHIFT) + PAGE_SIZE/2; } @@ -68,7 +68,7 @@ int xencons_ring_send(const char *data, unsigned len) int sent = 0; sent = __xencons_ring_send(out, data, len); - notify_via_evtchn(xen_start_info.console_evtchn); + notify_via_evtchn(xen_start_info->console_evtchn); return sent; } @@ -98,10 +98,10 @@ int xencons_ring_init(void) { int err; - if (!xen_start_info.console_evtchn) + if (!xen_start_info->console_evtchn) return 0; - err = bind_evtchn_to_irqhandler(xen_start_info.console_evtchn, + err = bind_evtchn_to_irqhandler(xen_start_info->console_evtchn, handle_input, 0, "xencons", inring()); if (err) { xprintk("XEN console request irq failed %i\n", err); @@ -114,10 +114,11 @@ int xencons_ring_init(void) void xencons_suspend(void) { - if (!xen_start_info.console_evtchn) + if (!xen_start_info->console_evtchn) return; - unbind_evtchn_from_irqhandler(xen_start_info.console_evtchn, inring()); + unbind_evtchn_from_irqhandler(xen_start_info->console_evtchn, + inring()); } void xencons_resume(void) diff --git a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c index f90d6f3572..32ceb5f0b9 100644 --- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c +++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c @@ -940,8 +940,8 @@ static int __init netback_init(void) int i; struct page *page; - if ( !(xen_start_info.flags & SIF_NET_BE_DOMAIN) && - !(xen_start_info.flags & SIF_INITDOMAIN) ) + if ( !(xen_start_info->flags & SIF_NET_BE_DOMAIN) && + !(xen_start_info->flags & SIF_INITDOMAIN) ) return 0; IPRINTK("Initialising Xen netif backend.\n"); diff --git a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c index 08db931a4a..45755083de 100644 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c @@ -1369,7 +1369,7 @@ static int __init netif_init(void) { int err = 0; - if (xen_start_info.flags & SIF_INITDOMAIN) + if (xen_start_info->flags & SIF_INITDOMAIN) return 0; if ((err = xennet_proc_init()) != 0) diff --git a/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c b/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c index 8877ddef72..76c8737963 100644 --- a/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c +++ b/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c @@ -205,8 +205,8 @@ static int privcmd_ioctl(struct inode *inode, struct file *file, extern int do_xenbus_probe(void*); unsigned long page; - if (xen_start_info.store_evtchn != 0) { - ret = xen_start_info.store_mfn; + if (xen_start_info->store_evtchn != 0) { + ret = xen_start_info->store_mfn; break; } @@ -222,10 +222,10 @@ static int privcmd_ioctl(struct inode *inode, struct file *file, SetPageReserved(virt_to_page(page)); /* Initial connect. Setup channel and page. */ - xen_start_info.store_evtchn = data; - xen_start_info.store_mfn = pfn_to_mfn(virt_to_phys((void *)page) >> + xen_start_info->store_evtchn = data; + xen_start_info->store_mfn = pfn_to_mfn(virt_to_phys((void *)page) >> PAGE_SHIFT); - ret = xen_start_info.store_mfn; + ret = xen_start_info->store_mfn; /* We'll return then this will wait for daemon to answer */ kthread_run(do_xenbus_probe, NULL, "xenbus_probe"); diff --git a/linux-2.6-xen-sparse/drivers/xen/tpmback/tpmback.c b/linux-2.6-xen-sparse/drivers/xen/tpmback/tpmback.c index 731b8557c4..ab79feb4fc 100644 --- a/linux-2.6-xen-sparse/drivers/xen/tpmback/tpmback.c +++ b/linux-2.6-xen-sparse/drivers/xen/tpmback/tpmback.c @@ -1047,8 +1047,8 @@ static int __init tpmback_init(void) { int rc; - if (!(xen_start_info.flags & SIF_TPM_BE_DOMAIN) && - !(xen_start_info.flags & SIF_INITDOMAIN)) { + if (!(xen_start_info->flags & SIF_TPM_BE_DOMAIN) && + !(xen_start_info->flags & SIF_INITDOMAIN)) { printk(KERN_ALERT "Neither TPM-BE Domain nor INIT domain!\n"); return 0; } diff --git a/linux-2.6-xen-sparse/drivers/xen/usbback/usbback.c b/linux-2.6-xen-sparse/drivers/xen/usbback/usbback.c index a8f4ad804d..043ab73eeb 100644 --- a/linux-2.6-xen-sparse/drivers/xen/usbback/usbback.c +++ b/linux-2.6-xen-sparse/drivers/xen/usbback/usbback.c @@ -1029,8 +1029,8 @@ static int __init usbif_init(void) int i; struct page *page; - if ( !(xen_start_info.flags & SIF_INITDOMAIN) && - !(xen_start_info.flags & SIF_USB_BE_DOMAIN) ) + if ( !(xen_start_info->flags & SIF_INITDOMAIN) && + !(xen_start_info->flags & SIF_USB_BE_DOMAIN) ) return 0; page = balloon_alloc_empty_page_range(MMAP_PAGES); diff --git a/linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront.c b/linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront.c index b745c1d695..403ebbdf09 100644 --- a/linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront.c +++ b/linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront.c @@ -1675,8 +1675,8 @@ static int __init xhci_hcd_init(void) { int retval = -ENOMEM, i; - if ( (xen_start_info.flags & SIF_INITDOMAIN) - || (xen_start_info.flags & SIF_USB_BE_DOMAIN) ) + if ( (xen_start_info->flags & SIF_INITDOMAIN) || + (xen_start_info->flags & SIF_USB_BE_DOMAIN) ) return 0; info(DRIVER_DESC " " DRIVER_VERSION); diff --git a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c index 6ea32b5394..3626d1086e 100644 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c @@ -48,12 +48,12 @@ DECLARE_WAIT_QUEUE_HEAD(xb_waitq); static inline struct ringbuf_head *outbuf(void) { - return mfn_to_virt(xen_start_info.store_mfn); + return mfn_to_virt(xen_start_info->store_mfn); } static inline struct ringbuf_head *inbuf(void) { - return mfn_to_virt(xen_start_info.store_mfn) + PAGE_SIZE/2; + return mfn_to_virt(xen_start_info->store_mfn) + PAGE_SIZE/2; } static irqreturn_t wake_waiting(int irq, void *unused, struct pt_regs *regs) @@ -145,7 +145,7 @@ int xb_write(const void *data, unsigned len) data += avail; len -= avail; update_output_chunk(out, avail); - notify_via_evtchn(xen_start_info.store_evtchn); + notify_via_evtchn(xen_start_info->store_evtchn); } while (len != 0); return 0; @@ -190,7 +190,7 @@ int xb_read(void *data, unsigned len) pr_debug("Finished read of %i bytes (%i to go)\n", avail, len); /* If it was full, tell them we've taken some. */ if (was_full) - notify_via_evtchn(xen_start_info.store_evtchn); + notify_via_evtchn(xen_start_info->store_evtchn); } /* If we left something, wake watch thread to deal with it. */ @@ -205,20 +205,20 @@ int xb_init_comms(void) { int err; - if (!xen_start_info.store_evtchn) + if (!xen_start_info->store_evtchn) return 0; err = bind_evtchn_to_irqhandler( - xen_start_info.store_evtchn, wake_waiting, + xen_start_info->store_evtchn, wake_waiting, 0, "xenbus", &xb_waitq); if (err) { printk(KERN_ERR "XENBUS request irq failed %i\n", err); - unbind_evtchn_from_irq(xen_start_info.store_evtchn); + unbind_evtchn_from_irq(xen_start_info->store_evtchn); return err; } /* FIXME zero out page -- domain builder should probably do this*/ - memset(mfn_to_virt(xen_start_info.store_mfn), 0, PAGE_SIZE); + memset(mfn_to_virt(xen_start_info->store_mfn), 0, PAGE_SIZE); return 0; } @@ -226,8 +226,8 @@ int xb_init_comms(void) void xb_suspend_comms(void) { - if (!xen_start_info.store_evtchn) + if (!xen_start_info->store_evtchn) return; - unbind_evtchn_from_irqhandler(xen_start_info.store_evtchn, &xb_waitq); + unbind_evtchn_from_irqhandler(xen_start_info->store_evtchn, &xb_waitq); } diff --git a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c index 2c9bd9877e..44dfbc9c05 100644 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c @@ -621,7 +621,7 @@ int register_xenstore_notifier(struct notifier_block *nb) down(&xenbus_lock); - if (xen_start_info.store_evtchn) { + if (xen_start_info->store_evtchn) { ret = nb->notifier_call(nb, 0, NULL); } else { notifier_chain_register(&xenstore_chain, nb); @@ -647,7 +647,7 @@ int do_xenbus_probe(void *unused) int err = 0; /* Initialize xenstore comms unless already done. */ - printk("store_evtchn = %i\n", xen_start_info.store_evtchn); + printk("store_evtchn = %i\n", xen_start_info->store_evtchn); err = xs_init(); if (err) { printk("XENBUS: Error initializing xenstore comms:" @@ -675,7 +675,7 @@ static int __init xenbus_probe_init(void) device_register(&xenbus_frontend.dev); device_register(&xenbus_backend.dev); - if (!xen_start_info.store_evtchn) + if (!xen_start_info->store_evtchn) return 0; do_xenbus_probe(NULL); diff --git a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/mach-xen/setup_arch_post.h b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/mach-xen/setup_arch_post.h index 92d41bbf79..b30853d2cf 100644 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/mach-xen/setup_arch_post.h +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/mach-xen/setup_arch_post.h @@ -8,7 +8,7 @@ static char * __init machine_specific_memory_setup(void) { - unsigned long max_pfn = xen_start_info.nr_pages; + unsigned long max_pfn = xen_start_info->nr_pages; e820.nr_map = 0; add_memory_region(0, PFN_PHYS(max_pfn), E820_RAM); @@ -23,7 +23,7 @@ void __init machine_specific_modify_cpu_capabilities(struct cpuinfo_x86 *c) clear_bit(X86_FEATURE_PSE, c->x86_capability); clear_bit(X86_FEATURE_PGE, c->x86_capability); clear_bit(X86_FEATURE_SEP, c->x86_capability); - if (!(xen_start_info.flags & SIF_PRIVILEGED)) + if (!(xen_start_info->flags & SIF_PRIVILEGED)) clear_bit(X86_FEATURE_MTRR, c->x86_capability); } diff --git a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/setup.h b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/setup.h index 0a0073ae71..5161768219 100644 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/setup.h +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/setup.h @@ -53,8 +53,8 @@ extern unsigned char boot_params[PARAM_SIZE]; #define AUX_DEVICE_INFO (*(unsigned char *) (PARAM+0x1FF)) #define LOADER_TYPE (*(unsigned char *) (PARAM+0x210)) #define KERNEL_START (*(unsigned long *) (PARAM+0x214)) -#define INITRD_START (__pa(xen_start_info.mod_start)) -#define INITRD_SIZE (xen_start_info.mod_len) +#define INITRD_START (__pa(xen_start_info->mod_start)) +#define INITRD_SIZE (xen_start_info->mod_len) #define EDID_INFO (*(struct edid_info *) (PARAM+0x440)) #define EDD_NR (*(unsigned char *) (PARAM+EDDNR)) #define EDD_MBR_SIG_NR (*(unsigned char *) (PARAM+EDD_MBR_SIG_NR_BUF)) diff --git a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/bootsetup.h b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/bootsetup.h index e36521ab35..7983eecd56 100644 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/bootsetup.h +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/bootsetup.h @@ -25,8 +25,8 @@ extern char x86_boot_params[BOOT_PARAM_SIZE]; #define LOADER_TYPE (*(unsigned char *) (PARAM+0x210)) #define KERNEL_START (*(unsigned int *) (PARAM+0x214)) -#define INITRD_START (__pa(xen_start_info.mod_start)) -#define INITRD_SIZE (xen_start_info.mod_len) +#define INITRD_START (__pa(xen_start_info->mod_start)) +#define INITRD_SIZE (xen_start_info->mod_len) #define EDID_INFO (*(struct edid_info *) (PARAM+0x440)) #define EDD_NR (*(unsigned char *) (PARAM+EDDNR)) diff --git a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/setup_arch_post.h b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/setup_arch_post.h index 5761edd144..7be26e8660 100644 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/setup_arch_post.h +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/setup_arch_post.h @@ -14,7 +14,7 @@ static char * __init machine_specific_memory_setup(void) who = "Xen"; start_pfn = 0; - max_pfn = xen_start_info.nr_pages; + max_pfn = xen_start_info->nr_pages; e820.nr_map = 0; add_memory_region(PFN_PHYS(start_pfn), PFN_PHYS(max_pfn) - PFN_PHYS(start_pfn), E820_RAM); @@ -29,7 +29,7 @@ void __init machine_specific_modify_cpu_capabilities(struct cpuinfo_x86 *c) clear_bit(X86_FEATURE_PSE, c->x86_capability); clear_bit(X86_FEATURE_PGE, c->x86_capability); clear_bit(X86_FEATURE_SEP, c->x86_capability); - if (!(xen_start_info.flags & SIF_PRIVILEGED)) + if (!(xen_start_info->flags & SIF_PRIVILEGED)) clear_bit(X86_FEATURE_MTRR, c->x86_capability); } diff --git a/linux-2.6-xen-sparse/include/asm-xen/hypervisor.h b/linux-2.6-xen-sparse/include/asm-xen/hypervisor.h index b87ec91e93..3c7a42723a 100644 --- a/linux-2.6-xen-sparse/include/asm-xen/hypervisor.h +++ b/linux-2.6-xen-sparse/include/asm-xen/hypervisor.h @@ -52,13 +52,7 @@ #endif /* arch/xen/i386/kernel/setup.c */ -union xen_start_info_union -{ - start_info_t xen_start_info; - char padding[2048]; -}; -extern union xen_start_info_union xen_start_info_union; -#define xen_start_info (xen_start_info_union.xen_start_info) +extern start_info_t *xen_start_info; /* arch/xen/kernel/evtchn.c */ /* Force a proper event-channel callback from Xen. */ diff --git a/tools/libxc/xc_linux_build.c b/tools/libxc/xc_linux_build.c index 3c284ca980..aa6e78156e 100644 --- a/tools/libxc/xc_linux_build.c +++ b/tools/libxc/xc_linux_build.c @@ -395,18 +395,18 @@ static int setup_guest(int xc_handle, vinitrd_end = vinitrd_start + initrd_len; vphysmap_start = round_pgup(vinitrd_end); vphysmap_end = vphysmap_start + (nr_pages * sizeof(unsigned long)); - vstoreinfo_start = round_pgup(vphysmap_end); + vstartinfo_start = round_pgup(vphysmap_end); + vstartinfo_end = vstartinfo_start + PAGE_SIZE; + vstoreinfo_start = vstartinfo_end; vstoreinfo_end = vstoreinfo_start + PAGE_SIZE; vconsole_start = vstoreinfo_end; - vconsole_end = vstoreinfo_end + PAGE_SIZE; + vconsole_end = vconsole_start + PAGE_SIZE; vpt_start = vconsole_end; for ( nr_pt_pages = 2; ; nr_pt_pages++ ) { vpt_end = vpt_start + (nr_pt_pages * PAGE_SIZE); - vstartinfo_start = vpt_end; - vstartinfo_end = vstartinfo_start + PAGE_SIZE; - vstack_start = vstartinfo_end; + vstack_start = vpt_end; vstack_end = vstack_start + PAGE_SIZE; v_end = (vstack_end + (1UL<<22)-1) & ~((1UL<<22)-1); if ( (v_end - vstack_end) < (512UL << 10) ) @@ -442,19 +442,19 @@ static int setup_guest(int xc_handle, " Loaded kernel: %p->%p\n" " Init. ramdisk: %p->%p\n" " Phys-Mach map: %p->%p\n" + " Start info: %p->%p\n" " Store page: %p->%p\n" " Console page: %p->%p\n" " Page tables: %p->%p\n" - " Start info: %p->%p\n" " Boot stack: %p->%p\n" " TOTAL: %p->%p\n", _p(dsi.v_kernstart), _p(dsi.v_kernend), _p(vinitrd_start), _p(vinitrd_end), _p(vphysmap_start), _p(vphysmap_end), + _p(vstartinfo_start), _p(vstartinfo_end), _p(vstoreinfo_start), _p(vstoreinfo_end), _p(vconsole_start), _p(vconsole_end), _p(vpt_start), _p(vpt_end), - _p(vstartinfo_start), _p(vstartinfo_end), _p(vstack_start), _p(vstack_end), _p(dsi.v_start), _p(v_end)); printf(" ENTRY ADDRESS: %p\n", _p(dsi.v_kernentry)); diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c index 474ad1b18b..0b9cbb1b29 100644 --- a/xen/arch/x86/domain_build.c +++ b/xen/arch/x86/domain_build.c @@ -219,13 +219,13 @@ int construct_dom0(struct domain *d, vinitrd_end = vinitrd_start + initrd_len; vphysmap_start = round_pgup(vinitrd_end); vphysmap_end = vphysmap_start + (nr_pages * sizeof(u32)); - vpt_start = round_pgup(vphysmap_end); + vstartinfo_start = round_pgup(vphysmap_end); + vstartinfo_end = vstartinfo_start + PAGE_SIZE; + vpt_start = vstartinfo_end; for ( nr_pt_pages = 2; ; nr_pt_pages++ ) { vpt_end = vpt_start + (nr_pt_pages * PAGE_SIZE); - vstartinfo_start = vpt_end; - vstartinfo_end = vstartinfo_start + PAGE_SIZE; - vstack_start = vstartinfo_end; + vstack_start = vpt_end; vstack_end = vstack_start + PAGE_SIZE; v_end = (vstack_end + (1UL<<22)-1) & ~((1UL<<22)-1); if ( (v_end - vstack_end) < (512UL << 10) ) @@ -272,15 +272,15 @@ int construct_dom0(struct domain *d, " Loaded kernel: %p->%p\n" " Init. ramdisk: %p->%p\n" " Phys-Mach map: %p->%p\n" - " Page tables: %p->%p\n" " Start info: %p->%p\n" + " Page tables: %p->%p\n" " Boot stack: %p->%p\n" " TOTAL: %p->%p\n", _p(dsi.v_kernstart), _p(dsi.v_kernend), _p(vinitrd_start), _p(vinitrd_end), _p(vphysmap_start), _p(vphysmap_end), - _p(vpt_start), _p(vpt_end), _p(vstartinfo_start), _p(vstartinfo_end), + _p(vpt_start), _p(vpt_end), _p(vstack_start), _p(vstack_end), _p(dsi.v_start), _p(v_end)); printk(" ENTRY ADDRESS: %p\n", _p(dsi.v_kernentry)); -- 2.30.2